#include "stdafx.h"
#include "net/HTTPBufferAllocator.hpp"

NET_NAMESPACE_BEGIN

CMemoryPool CHTTPBufferAllocator::m_pool(CHTTPBufferAllocator::BUFFER_SIZE, 16);


char* CHTTPBufferAllocator::allocate(std::streamsize size)
{
	jh_assert_dbg (size == BUFFER_SIZE);

	return reinterpret_cast<char*>(m_pool.get());
}


void CHTTPBufferAllocator::deallocate(char* ptr, std::streamsize size)
{
	jh_assert_dbg (size == BUFFER_SIZE);

	m_pool.release(ptr);
}

NET_NAMESPACE_END
